package com.eascs.crm.nsEditDetail.service;

import com.eascs.admin.common.vo.ModelResult;
import com.eascs.admin.o2o.loan.entity.O2oLoanUserEntity;
import com.eascs.crm.nsEditDetail.dao.SponsorDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class SponsorInfoService {

	@Autowired
	SponsorDao sponsorDao;

	
	public ModelResult<O2oLoanUserEntity> saveEntity(O2oLoanUserEntity entity) {
		ModelResult<O2oLoanUserEntity> modelResult =new ModelResult<>();
		boolean result = sponsorDao.saveEntity(entity);
		if(!result){
			return modelResult.withError(null,"插入失败");
		}
		modelResult.setModel(entity);
		return modelResult;
	}
	
	
	public O2oLoanUserEntity queryEntityByDocumentNo(String documentNo) {
		return sponsorDao.queryEntityByDocumentNo(documentNo);
	}
	
}
